<?php
/* 
 * Protótipo v1.1
 * UCB - UNIVERSIDADE CATÓLICA DE BRASÍLIA
 * TCC - APLICAÇÃO TWITTER CGU
 */

    require_once('api/twitteroauth/twitteroauth.php');

//    $ck="nHT6t8N21BYTebh53Q7yiA";
//    $cs="fvAUfhTQFFd5h9Nf3czalplyWvaXZkuvzJvkiAhr6Q";
//    $at="124000228-YNfFXgtoXjXyiyqiuii47pRGUpgoe6MwAU7HT0QO";
//    $ats="t1I6MJlhAUayKgoDQzi8tR4LAoXazpNbSM7NQRNH6Q";
    $ck="KLiVpD0P5zRGkgI2HFmwlA";
    $cs="BcgkzIc3QcYwmGaaFdpKhU4ydvbGT6Yz5C0wmUo";
    $at="71238178-3edsNRP6UUKCBMnEUw1Qj5DKFUsm88ylyUP2MgTli";
    $ats="zZpI6995tM7CsbpbP577PHq0CE88q5cNRSIx9OJ6xM";

    //Cria a conexão com o twitter usando OAuth
    $connection = new TwitterOAuth($ck, $cs, $at, $ats);

    //Procura o usuário fornecido
    $result = $connection->get('users/show',array(
        'screen_name'=>'TheOfficialA7X'
    ));

    //Mostra as informações do usuário fornecido
    echo "<table border='1' align='center'><tbody>";
    echo ($result->notifications!=null)?("<tr><td>notifications</td><td>".$result->notifications."</td></tr>"):("<tr><td>notifications</td><td>valor nulo</td></tr>");
    echo ($result->time_zone!=null)?("<tr><td>time_zone</td><td>".$result->time_zone."</td></tr>"):("<tr><td>time_zone</td><td>valor nulo</td></tr>");
    echo ($result->description!=null)?("<tr><td>descriptd>".utf8_decode($result->status->text)."</td></tr>"):("<tr><td>status</td><td>sem status</td></tr>");
    echo ($result->screen_name!=null)?("<tr><td>screen_nion</td><td>".utf8_decode($result->description)."</td></tr>"):("<tr><td>description</td><td>valor nulo</td></tr>");
    echo ($result->status!=null)?("<tr><td>status</td><tame</td><td>".$result->screen_name."</td></tr>"):("<tr><td>screen_name</td><td>valor nulo</td></tr>");
    echo ($result->verified)?("<tr><td>verified</td><td>valor verdadeiro</td></tr>"):("<tr><td>verified</td><td>valor falso</td></tr>");
    echo ($result->profile_background_color!=null)?("<tr><td>profile_background_color</td><td>".$result->profile_background_color."</td></tr>"):("<tr><td>profile_background_color</td><td>valor nulo</td></tr>");
    echo ($result->follow_request_sent!=null)?("<tr><td>follow_request_sent</td><td>".$result->follow_request_sent."</td></tr>"):("<tr><td>follow_request_sent</td><td>valor nulo</td></tr>");
    echo ($result->profile_use_background_image)?("<tr><td>profile_use_background_image</td><td>Usa imagem de fundo</td></tr>"):("<tr><td>profile_use_background_image</td><td>Nao usa imagem de fundo</td></tr>");
    echo ($result->profile_text_color!=null)?("<tr><td>profile_text_color</td><td>".$result->profile_text_color."</td></tr>"):("<tr><td>profile_text_color</td><td>valor nulo</td></tr>");
    echo ($result->url!=null)?("<tr><td>url</td><td>".$result->url."</td></tr>"):("<tr><td>url</td><td>valor nulo</td></tr>");
    echo ($result->profile_background_image_url!=null)?("<tr><td>profile_background_image_url</td><td>".$result->profile_background_image_url."</td></tr>"):("<tr><td>profile_background_image_url</td><td>valor nulo</td></tr>");
    echo ($result->profile_link_color!=null)?("<tr><td>profile_link_color</td><td>".$result->profile_link_color."</td></tr>"):("<tr><td>profile_link_color</td><td>valor nulo</td></tr>");
    echo ($result->listed_count!=null)?("<tr><td>listed_count</td><td>".$result->listed_count."</td></tr>"):("<tr><td>listed_count</td><td>valor nulo || 0</td></tr>");
    echo ($result->lang!=null)?("<tr><td>lang</td><td>".$result->lang."</td></tr>"):("<tr><td>lang</td><td>valor nulo</td></tr>");
    echo ($result->created_at!=null)?("<tr><td>created_at</td><td>".$result->created_at."</td></tr>"):("<tr><td>created_at</td><td>valor nulo</td></tr>");
    echo ($result->location!=null)?("<tr><td>location</td><td>".$result->location."</td></tr>"):("<tr><td>location</td><td>valor nulo</td></tr>");
    echo ($result->statuses_count!=null)?("<tr><td>statuses_count</td><td>".$result->statuses_count."</td></tr>"):("<tr><td>statuses_count</td><td>valor nulo</td></tr>");
    echo ($result->profile_background_tile)?("<tr><td>profile_background_tile</td><td>Formado por imagem repetida</td></tr>"):("<tr><td>profile_background_tile</td><td>Nao formado por imagem repetida</td></tr>");
    echo ($result->profile_sidebar_fill_color!=null)?("<tr><td>profile_sidebar_fill_color</td><td>".$result->profile_sidebar_fill_color."</td></tr>"):("<tr><td>profile_sidebar_fill_color</td><td>valor nulo</td></tr>");
    echo ($result->protected)?("<tr><td>protected</td><td>Protegido</td></tr>"):("<tr><td>protected</td><td>Nao protegido</td></tr>");
    echo ($result->show_all_inline_media)?("<tr><td>show_all_inline_media</td><td>Link para midia</td></tr>"):("<tr><td>show_all_inline_media</td><td>Sem link para midia</td></tr>");
    echo ($result->friends_count!=null)?("<tr><td>friends_count</td><td>".$result->friends_count."</td></tr>"):("<tr><td>friends_count</td><td>valor nulo</td></tr>");
    echo ($result->name!=null)?("<tr><td>name</td><td>".$result->name."</td></tr>"):("<tr><td>name</td><td>valor nulo</td></tr>");
    echo ($result->id_str!=null)?("<tr><td>id_str</td><td>".$result->id_str."</td></tr>"):("<tr><td>id_str</td><td>valor nulo</td></tr>");
    echo ($result->contributors_enabled)?("<tr><td>contributors_enabled</td><td>Contribuicao ativada</td></tr>"):("<tr><td>contributors_enabled</td><td>Contribuicao Desativada</td></tr>");
    echo ($result->following!=null)?("<tr><td>following</td><td>".$result->following."</td></tr>"):("<tr><td>following</td><td>valor nulo</td></tr>");
    echo ($result->favourites_count>0)?("<tr><td>favourites_count</td><td>".$result->favourites_count."</td></tr>"):("<tr><td>favourites_count</td><td>0 favoritos</td></tr>");
    echo ($result->profile_sidebar_border_color!=null)?("<tr><td>profile_sidebar_border_color</td><td>".$result->profile_sidebar_border_color."</td></tr>"):("<tr><td>profile_sidebar_border_color</td><td>valor nulo</td></tr>");
    echo ($result->followers_count!=null)?("<tr><td>followers_count</td><td>".$result->followers_count."</td></tr>"):("<tr><td>followers_count</td><td>valor nulo</td></tr>");
    echo ($result->profile_image_url!=null)?("<tr><td>profile_image_url</td><td>".$result->profile_image_url."</td></tr>"):("<tr><td>profile_image_url</td><td>valor nulo</td></tr>");
    echo ($result->geo_enabled!=null)?("<tr><td>geo_enabled</td><td>".$result->geo_enabled."</td></tr>"):("<tr><td>geo_enabled</td><td>valor nulo</td></tr>");
    echo ($result->utc_offset!=null)?("<tr><td>utc_offset</td><td>".$result->utc_offset."</td></tr>"):("<tr><td>utc_offset</td><td>valor nulo</td></tr>");
    echo ($result->tweeter_id!=null)?("<tr><td>tweeter_id</td><td>".$result->tweeter_id."</td></tr>"):("<tr><td>tweeter_id</td><td>valor nulo</td></tr>");
    echo "</tbody></table>";

    //Recebe a lista dos 100 primeiros contatos - sem paginação
    // $result = $connection->get('statuses/friends',array(
    //));

     //mostra os 100 primeiros contatos
//     while($result){
//        echo "<table border='1' align='center'><caption>Amigo $i </caption><tbody>";
//        echo ($result[$i]->notifications!=null)?("<tr><td>notifications</td><td>".$result[$i]->notifications."</td></tr>"):("<tr><td>notifications</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->time_zone!=null)?("<tr><td>time_zone</td><td>".$result[$i]->time_zone."</td></tr>"):("<tr><td>time_zone</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->description!=null)?("<tr><td>description</td><td>".utf8_decode($result[$i]->description)."</td></tr>"):("<tr><td>description</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->status!=null)?("<tr><td>status</td><td>".utf8_decode($result[$i]->status->text)."</td></tr>"):("<tr><td>status</td><td>sem status</td></tr>");
//        echo ($result[$i]->screen_name!=null)?("<tr><td>screen_name</td><td>".$result[$i]->screen_name."</td></tr>"):("<tr><td>screen_name</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->verified)?("<tr><td>verified</td><td>valor verdadeiro</td></tr>"):("<tr><td>verified</td><td>valor falso</td></tr>");
//        echo ($result[$i]->profile_background_color!=null)?("<tr><td>profile_background_color</td><td>".$result[$i]->profile_background_color."</td></tr>"):("<tr><td>profile_background_color</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->follow_request_sent!=null)?("<tr><td>follow_request_sent</td><td>".$result[$i]->follow_request_sent."</td></tr>"):("<tr><td>follow_request_sent</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->profile_use_background_image)?("<tr><td>profile_use_background_image</td><td>Usa imagem de fundo</td></tr>"):("<tr><td>profile_use_background_image</td><td>Nao usa imagem de fundo</td></tr>");
//        echo ($result[$i]->profile_text_color!=null)?("<tr><td>profile_text_color</td><td>".$result[$i]->profile_text_color."</td></tr>"):("<tr><td>profile_text_color</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->url!=null)?("<tr><td>url</td><td>".$result[$i]->url."</td></tr>"):("<tr><td>url</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->profile_background_image_url!=null)?("<tr><td>profile_background_image_url</td><td>".$result[$i]->profile_background_image_url."</td></tr>"):("<tr><td>profile_background_image_url</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->profile_link_color!=null)?("<tr><td>profile_link_color</td><td>".$result[$i]->profile_link_color."</td></tr>"):("<tr><td>profile_link_color</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->listed_count!=null)?("<tr><td>listed_count</td><td>".$result[$i]->listed_count."</td></tr>"):("<tr><td>listed_count</td><td>valor nulo || 0</td></tr>");
//        echo ($result[$i]->lang!=null)?("<tr><td>lang</td><td>".$result[$i]->lang."</td></tr>"):("<tr><td>lang</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->created_at!=null)?("<tr><td>created_at</td><td>".$result[$i]->created_at."</td></tr>"):("<tr><td>created_at</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->location!=null)?("<tr><td>location</td><td>".$result[$i]->location."</td></tr>"):("<tr><td>location</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->statuses_count!=null)?("<tr><td>statuses_count</td><td>".$result[$i]->statuses_count."</td></tr>"):("<tr><td>statuses_count</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->profile_background_tile)?("<tr><td>profile_background_tile</td><td>Formado por imagem repetida</td></tr>"):("<tr><td>profile_background_tile</td><td>Nao formado por imagem repetida</td></tr>");
//        echo ($result[$i]->profile_sidebar_fill_color!=null)?("<tr><td>profile_sidebar_fill_color</td><td>".$result[$i]->profile_sidebar_fill_color."</td></tr>"):("<tr><td>profile_sidebar_fill_color</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->protected)?("<tr><td>protected</td><td>Protegido</td></tr>"):("<tr><td>protected</td><td>Nao protegido</td></tr>");
//        echo ($result[$i]->show_all_inline_media)?("<tr><td>show_all_inline_media</td><td>Link para midia</td></tr>"):("<tr><td>show_all_inline_media</td><td>Sem link para midia</td></tr>");
//        echo ($result[$i]->friends_count!=null)?("<tr><td>friends_count</td><td>".$result[$i]->friends_count."</td></tr>"):("<tr><td>friends_count</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->name!=null)?("<tr><td>name</td><td>".$result[$i]->name."</td></tr>"):("<tr><td>name</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->id_str!=null)?("<tr><td>id_str</td><td>".$result[$i]->id_str."</td></tr>"):("<tr><td>id_str</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->contributors_enabled)?("<tr><td>contributors_enabled</td><td>Contribuicao ativada</td></tr>"):("<tr><td>contributors_enabled</td><td>Contribuicao Desativada</td></tr>");
//        echo ($result[$i]->following!=null)?("<tr><td>following</td><td>".$result[$i]->following."</td></tr>"):("<tr><td>following</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->favourites_count>0)?("<tr><td>favourites_count</td><td>".$result[$i]->favourites_count."</td></tr>"):("<tr><td>favourites_count</td><td>0 favoritos</td></tr>");
//        echo ($result[$i]->profile_sidebar_border_color!=null)?("<tr><td>profile_sidebar_border_color</td><td>".$result[$i]->profile_sidebar_border_color."</td></tr>"):("<tr><td>profile_sidebar_border_color</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->followers_count!=null)?("<tr><td>followers_count</td><td>".$result[$i]->followers_count."</td></tr>"):("<tr><td>followers_count</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->profile_image_url!=null)?("<tr><td>profile_image_url</td><td>".$result[$i]->profile_image_url."</td></tr>"):("<tr><td>profile_image_url</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->geo_enabled!=null)?("<tr><td>geo_enabled</td><td>".$result[$i]->geo_enabled."</td></tr>"):("<tr><td>geo_enabled</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->utc_offset!=null)?("<tr><td>utc_offset</td><td>".$result[$i]->utc_offset."</td></tr>"):("<tr><td>utc_offset</td><td>valor nulo</td></tr>");
//        echo ($result[$i]->tweeter_id!=null)?("<tr><td>tweeter_id</td><td>".$result[$i]->tweeter_id."</td></tr>"):("<tr><td>tweeter_id</td><td>valor nulo</td></tr>");
//        echo "</tbody></table>";
//     }

    //Recupera as informações dos contatos com paginação
    $cursor="-1";
     $result = $connection->get('statuses/friends',array(

         //propriedade que configura a paginação ! é opcional mas se omitida retorna apenas os 100 primeiros contatos.
         'screen_name'=>'TheOfficialA7X',
         "cursor" => $cursor
     ));

     //calcula o total de usuários
     $total = count($result->users);

     //mostra as informações dos contatos
     for($i=0;$i<$total;$i++){
        echo "<table border='1' align='center'><caption>Amigo $i </caption><tbody>";
        echo ($result->users[$i]->notifications!=null)?("<tr><td>notifications</td><td>".$result->users[$i]->notifications."</td></tr>"):("<tr><td>notifications</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->time_zone!=null)?("<tr><td>time_zone</td><td>".$result->users[$i]->time_zone."</td></tr>"):("<tr><td>time_zone</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->description!=null)?("<tr><td>description</td><td>".utf8_decode($result->users[$i]->description)."</td></tr>"):("<tr><td>description</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->status!=null)?("<tr><td>status</td><td>".utf8_decode($result->users[$i]->status->text)."</td></tr>"):("<tr><td>status</td><td>sem status</td></tr>");
        echo ($result->users[$i]->screen_name!=null)?("<tr><td>screen_name</td><td>".$result->users[$i]->screen_name."</td></tr>"):("<tr><td>screen_name</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->verified)?("<tr><td>verified</td><td>valor verdadeiro</td></tr>"):("<tr><td>verified</td><td>valor falso</td></tr>");
        echo ($result->users[$i]->profile_background_color!=null)?("<tr><td>profile_background_color</td><td>".$result->users[$i]->profile_background_color."</td></tr>"):("<tr><td>profile_background_color</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->follow_request_sent!=null)?("<tr><td>follow_request_sent</td><td>".$result->users[$i]->follow_request_sent."</td></tr>"):("<tr><td>follow_request_sent</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->profile_use_background_image)?("<tr><td>profile_use_background_image</td><td>Usa imagem de fundo</td></tr>"):("<tr><td>profile_use_background_image</td><td>Nao usa imagem de fundo</td></tr>");
        echo ($result->users[$i]->profile_text_color!=null)?("<tr><td>profile_text_color</td><td>".$result->users[$i]->profile_text_color."</td></tr>"):("<tr><td>profile_text_color</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->url!=null)?("<tr><td>url</td><td>".$result->users[$i]->url."</td></tr>"):("<tr><td>url</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->profile_background_image_url!=null)?("<tr><td>profile_background_image_url</td><td>".$result->users[$i]->profile_background_image_url."</td></tr>"):("<tr><td>profile_background_image_url</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->profile_link_color!=null)?("<tr><td>profile_link_color</td><td>".$result->users[$i]->profile_link_color."</td></tr>"):("<tr><td>profile_link_color</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->listed_count!=null)?("<tr><td>listed_count</td><td>".$result->users[$i]->listed_count."</td></tr>"):("<tr><td>listed_count</td><td>valor nulo || 0</td></tr>");
        echo ($result->users[$i]->lang!=null)?("<tr><td>lang</td><td>".$result->users[$i]->lang."</td></tr>"):("<tr><td>lang</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->created_at!=null)?("<tr><td>created_at</td><td>".$result->users[$i]->created_at."</td></tr>"):("<tr><td>created_at</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->location!=null)?("<tr><td>location</td><td>".$result->users[$i]->location."</td></tr>"):("<tr><td>location</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->statuses_count!=null)?("<tr><td>statuses_count</td><td>".$result->users[$i]->statuses_count."</td></tr>"):("<tr><td>statuses_count</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->profile_background_tile)?("<tr><td>profile_background_tile</td><td>Formado por imagem repetida</td></tr>"):("<tr><td>profile_background_tile</td><td>Nao formado por imagem repetida</td></tr>");
        echo ($result->users[$i]->profile_sidebar_fill_color!=null)?("<tr><td>profile_sidebar_fill_color</td><td>".$result->users[$i]->profile_sidebar_fill_color."</td></tr>"):("<tr><td>profile_sidebar_fill_color</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->protected)?("<tr><td>protected</td><td>Protegido</td></tr>"):("<tr><td>protected</td><td>Nao protegido</td></tr>");
        echo ($result->users[$i]->show_all_inline_media)?("<tr><td>show_all_inline_media</td><td>Link para midia</td></tr>"):("<tr><td>show_all_inline_media</td><td>Sem link para midia</td></tr>");
        echo ($result->users[$i]->friends_count!=null)?("<tr><td>friends_count</td><td>".$result->users[$i]->friends_count."</td></tr>"):("<tr><td>friends_count</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->name!=null)?("<tr><td>name</td><td>".$result->users[$i]->name."</td></tr>"):("<tr><td>name</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->id_str!=null)?("<tr><td>id_str</td><td>".$result->users[$i]->id_str."</td></tr>"):("<tr><td>id_str</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->contributors_enabled)?("<tr><td>contributors_enabled</td><td>Contribuicao ativada</td></tr>"):("<tr><td>contributors_enabled</td><td>Contribuicao Desativada</td></tr>");
        echo ($result->users[$i]->following!=null)?("<tr><td>following</td><td>".$result->users[$i]->following."</td></tr>"):("<tr><td>following</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->favourites_count>0)?("<tr><td>favourites_count</td><td>".$result->users[$i]->favourites_count."</td></tr>"):("<tr><td>favourites_count</td><td>0 favoritos</td></tr>");
        echo ($result->users[$i]->profile_sidebar_border_color!=null)?("<tr><td>profile_sidebar_border_color</td><td>".$result->users[$i]->profile_sidebar_border_color."</td></tr>"):("<tr><td>profile_sidebar_border_color</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->followers_count!=null)?("<tr><td>followers_count</td><td>".$result->users[$i]->followers_count."</td></tr>"):("<tr><td>followers_count</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->profile_image_url!=null)?("<tr><td>profile_image_url</td><td>".$result->users[$i]->profile_image_url."</td></tr>"):("<tr><td>profile_image_url</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->geo_enabled!=null)?("<tr><td>geo_enabled</td><td>".$result->users[$i]->geo_enabled."</td></tr>"):("<tr><td>geo_enabled</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->utc_offset!=null)?("<tr><td>utc_offset</td><td>".$result->users[$i]->utc_offset."</td></tr>"):("<tr><td>utc_offset</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->tweeter_id!=null)?("<tr><td>tweeter_id</td><td>".$result->users[$i]->tweeter_id."</td></tr>"):("<tr><td>tweeter_id</td><td>valor nulo</td></tr>");
        echo "</tbody></table>";
    }

    //Recebe o valor da próxima página e realiza a consulta
    $next = number_format($result->next_cursor, 0, '.', '');
    $result = $connection->get('statuses/friends',array(
         "cursor" => $next
     ));

    //calcula o total da nova consulta
     $total = count($result->users);
     
     //mostra resultados da nova consulta
     for($i=0;$i<$total;$i++){
        echo "<table border='1' align='center'><caption>Amigo $i </caption><tbody>";
        echo ($result->users[$i]->notifications!=null)?("<tr><td>notifications</td><td>".$result->users[$i]->notifications."</td></tr>"):("<tr><td>notifications</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->time_zone!=null)?("<tr><td>time_zone</td><td>".$result->users[$i]->time_zone."</td></tr>"):("<tr><td>time_zone</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->description!=null)?("<tr><td>description</td><td>".utf8_decode($result->users[$i]->description)."</td></tr>"):("<tr><td>description</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->status!=null)?("<tr><td>status</td><td>".utf8_decode($result->users[$i]->status->text)."</td></tr>"):("<tr><td>status</td><td>sem status</td></tr>");
        echo ($result->users[$i]->screen_name!=null)?("<tr><td>screen_name</td><td>".$result->users[$i]->screen_name."</td></tr>"):("<tr><td>screen_name</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->verified)?("<tr><td>verified</td><td>valor verdadeiro</td></tr>"):("<tr><td>verified</td><td>valor falso</td></tr>");
        echo ($result->users[$i]->profile_background_color!=null)?("<tr><td>profile_background_color</td><td>".$result->users[$i]->profile_background_color."</td></tr>"):("<tr><td>profile_background_color</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->follow_request_sent!=null)?("<tr><td>follow_request_sent</td><td>".$result->users[$i]->follow_request_sent."</td></tr>"):("<tr><td>follow_request_sent</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->profile_use_background_image)?("<tr><td>profile_use_background_image</td><td>Usa imagem de fundo</td></tr>"):("<tr><td>profile_use_background_image</td><td>Nao usa imagem de fundo</td></tr>");
        echo ($result->users[$i]->profile_text_color!=null)?("<tr><td>profile_text_color</td><td>".$result->users[$i]->profile_text_color."</td></tr>"):("<tr><td>profile_text_color</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->url!=null)?("<tr><td>url</td><td>".$result->users[$i]->url."</td></tr>"):("<tr><td>url</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->profile_background_image_url!=null)?("<tr><td>profile_background_image_url</td><td>".$result->users[$i]->profile_background_image_url."</td></tr>"):("<tr><td>profile_background_image_url</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->profile_link_color!=null)?("<tr><td>profile_link_color</td><td>".$result->users[$i]->profile_link_color."</td></tr>"):("<tr><td>profile_link_color</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->listed_count!=null)?("<tr><td>listed_count</td><td>".$result->users[$i]->listed_count."</td></tr>"):("<tr><td>listed_count</td><td>valor nulo || 0</td></tr>");
        echo ($result->users[$i]->lang!=null)?("<tr><td>lang</td><td>".$result->users[$i]->lang."</td></tr>"):("<tr><td>lang</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->created_at!=null)?("<tr><td>created_at</td><td>".$result->users[$i]->created_at."</td></tr>"):("<tr><td>created_at</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->location!=null)?("<tr><td>location</td><td>".$result->users[$i]->location."</td></tr>"):("<tr><td>location</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->statuses_count!=null)?("<tr><td>statuses_count</td><td>".$result->users[$i]->statuses_count."</td></tr>"):("<tr><td>statuses_count</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->profile_background_tile)?("<tr><td>profile_background_tile</td><td>Formado por imagem repetida</td></tr>"):("<tr><td>profile_background_tile</td><td>Nao formado por imagem repetida</td></tr>");
        echo ($result->users[$i]->profile_sidebar_fill_color!=null)?("<tr><td>profile_sidebar_fill_color</td><td>".$result->users[$i]->profile_sidebar_fill_color."</td></tr>"):("<tr><td>profile_sidebar_fill_color</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->protected)?("<tr><td>protected</td><td>Protegido</td></tr>"):("<tr><td>protected</td><td>Nao protegido</td></tr>");
        echo ($result->users[$i]->show_all_inline_media)?("<tr><td>show_all_inline_media</td><td>Link para midia</td></tr>"):("<tr><td>show_all_inline_media</td><td>Sem link para midia</td></tr>");
        echo ($result->users[$i]->friends_count!=null)?("<tr><td>friends_count</td><td>".$result->users[$i]->friends_count."</td></tr>"):("<tr><td>friends_count</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->name!=null)?("<tr><td>name</td><td>".$result->users[$i]->name."</td></tr>"):("<tr><td>name</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->id_str!=null)?("<tr><td>id_str</td><td>".$result->users[$i]->id_str."</td></tr>"):("<tr><td>id_str</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->contributors_enabled)?("<tr><td>contributors_enabled</td><td>Contribuicao ativada</td></tr>"):("<tr><td>contributors_enabled</td><td>Contribuicao Desativada</td></tr>");
        echo ($result->users[$i]->following!=null)?("<tr><td>following</td><td>".$result->users[$i]->following."</td></tr>"):("<tr><td>following</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->favourites_count>0)?("<tr><td>favourites_count</td><td>".$result->users[$i]->favourites_count."</td></tr>"):("<tr><td>favourites_count</td><td>0 favoritos</td></tr>");
        echo ($result->users[$i]->profile_sidebar_border_color!=null)?("<tr><td>profile_sidebar_border_color</td><td>".$result->users[$i]->profile_sidebar_border_color."</td></tr>"):("<tr><td>profile_sidebar_border_color</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->followers_count!=null)?("<tr><td>followers_count</td><td>".$result->users[$i]->followers_count."</td></tr>"):("<tr><td>followers_count</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->profile_image_url!=null)?("<tr><td>profile_image_url</td><td>".$result->users[$i]->profile_image_url."</td></tr>"):("<tr><td>profile_image_url</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->geo_enabled!=null)?("<tr><td>geo_enabled</td><td>".$result->users[$i]->geo_enabled."</td></tr>"):("<tr><td>geo_enabled</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->utc_offset!=null)?("<tr><td>utc_offset</td><td>".$result->users[$i]->utc_offset."</td></tr>"):("<tr><td>utc_offset</td><td>valor nulo</td></tr>");
        echo ($result->users[$i]->tweeter_id!=null)?("<tr><td>tweeter_id</td><td>".$result->users[$i]->tweeter_id."</td></tr>"):("<tr><td>tweeter_id</td><td>valor nulo</td></tr>");
        echo "</tbody></table>";
    }
?>
